package com.wctj.api.base.enums;

/**
 * 枚举
 * @author: lzg
 * @description: : MALE：男，FEMALE：女，为空时表示未填写
 */
public enum GenderEnums {
    MALE (1,"男"),
    FEMALE(0,"女"),

    ;

    private int code;
    private String msg;

    public String getMsg() {
        return msg;
    }

    GenderEnums(int code, String message) {
        this.code = code;
        this.msg = message;
    }

    public static GenderEnums of(int code) {
        for (GenderEnums plat : GenderEnums.values()) {
            if (plat.getCode()== code) {
                return plat;
            }
        }
        return null;
    }
    public static GenderEnums of(String name) {
        for (GenderEnums plat : GenderEnums.values()) {
            if (plat.name().equalsIgnoreCase(name)) {
                return plat;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }
}

